
const str = "http://www.baidu.com:3000/abc/asd?kd=上海&key=1q344#top";

const url = new URL(str);

console.log(url);

console.log(url.searchParams);

console.log(url.searchParams.kd);
console.log(url.searchParams.key);

console.log(url.searchParams.get("kd"));
console.log(url.searchParams.get("key"));
